#pragma once
#include "../Base.h"


#pragma pack(4)




EXTERN_C
NTKERNELAPI PPEB  NTAPI PsGetProcessPeb(__in PEPROCESS Process);



EXTERN_C
ULONG GetThreadModeOffset();
EXTERN_C
BOOLEAN SetThreadMode(PETHREAD thread, MODE newMode, MODE * oldMode);
EXTERN_C
NTSTATUS GetNtModuleBaseAndSize(ULONG64* pModule, ULONG64* pSize);
EXTERN_C
ULONG_PTR GetProcAddressR(ULONG_PTR hModule, const char* lpProcName, BOOLEAN x64Module);


EXTERN_C
ULONG GetWindowsVersionNumber();


EXTERN_C
LONG SafeSearchString(IN PUNICODE_STRING source, IN PUNICODE_STRING target, IN BOOLEAN CaseInSensitive);

EXTERN_C NTSTATUS  ObReferenceObjectByName(
	IN PUNICODE_STRING ObjectName,
	IN ULONG Attributes,
	IN PACCESS_STATE PassedAccessState OPTIONAL,
	IN ACCESS_MASK DesiredAccess OPTIONAL,
	IN POBJECT_TYPE ObjectType,
	IN KPROCESSOR_MODE AccessMode,
	IN OUT PVOID ParseContext OPTIONAL,
	OUT PVOID *Object
);



NTSTATUS
MmCopyVirtualMemory(
	IN PEPROCESS FromProcess,
	IN CONST VOID *FromAddress,
	IN PEPROCESS ToProcess,
	OUT PVOID ToAddress,
	IN SIZE_T BufferSize,
	IN KPROCESSOR_MODE PreviousMode,
	OUT PSIZE_T NumberOfBytesCopied
);
